<template>
  <view v-if="params.url">
    <web-view :webview-styles="webviewStyles" :src="`${params.url}`"></web-view>
  </view>
</template>

<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { setTitle } from '@/utils/common'

const props = defineProps({
  searchText: {
    type: String,
    default: '',
  },
})

const params = ref({})
const webviewStyles = ref({
  progress: {
    color: '#FF3333',
  },
})

onLoad((option) => {
  params.value = option
  if (option.title) {
    setTitle(option.title)
  }
})
</script>